function main(defaultParams) {
    var self = this;
    debugger
    api.EXEC_FORMULA("TREE_QUERY_CHILDRENS('be4cf00c-c3cf-47c0-873a-71e3d177e145','" + defaultParams.id + "',['unit_id'])").then((res) => {
        var tabEle = self.$$("tabs_35feon");
        if (tabEle) {
            let pageTableList1 = self.$$("page_widget_list_qi95w");
            let pageTableList2 = self.$$("page_widget_list_3eecc2");
            let pageTableList3 = self.$$("page_widget_list_c7gndy");

            if (pageTableList1 && pageTableList1.dataEngine && pageTableList1.dataEngine.state) {
                let tableComp1 = pageTableList1.dataEngine.state.getElement("table_4w2els");
                let tableComp2 = pageTableList2.dataEngine.state.getElement("table_4w2els");
                let tableComp3 = pageTableList3.dataEngine.state.getElement("table_4w2els");

                if (tableComp1) {

                    let members1 = pageTableList1.dataEngine.state.layout.props.dataSet.filterData.filter.members.slice(0, 1);
                    let members2 = pageTableList2.dataEngine.state.layout.props.dataSet.filterData.filter.members.slice(0, 1);
                    let members3 = pageTableList3.dataEngine.state.layout.props.dataSet.filterData.filter.members.slice(0, 1);

                    members1.push({
                        field: "508ba045-fb5d-4e3c-a081-80ee500705b3",
                        fieldName: "unit_id",
                        "fieldType": "TYPE_INTEGER",
                        valueType: "Constant",
                        values: res.result || [],
                        value: "",
                        operate: "In", // 范围查询
                        className: "Single"
                    });
                    var filter1 = {
                        "combine": "And",
                        "className": "List",
                        "members": members1
                    };
                    pageTableList1.dataEngine.state.layout.props.dataSet.filterData = {
                        "enabled": true,
                        "filter": filter1,
                        "filterType": "FILTER",
                        "rawCondition": {},
                        "rawFormula": ""
                    }

                    members2.push({
                        field: "508ba045-fb5d-4e3c-a081-80ee500705b3",
                        fieldName: "unit_id",
                        "fieldType": "TYPE_INTEGER",
                        valueType: "Constant",
                        values: res.result || [],
                        value: "",
                        operate: "In", // 范围查询
                        className: "Single"
                    });
                    var filter2 = {
                        "combine": "And",
                        "className": "List",
                        "members": members2
                    };
                    pageTableList2.dataEngine.state.layout.props.dataSet.filterData = {
                        "enabled": true,
                        "filter": filter2,
                        "filterType": "FILTER",
                        "rawCondition": {},
                        "rawFormula": ""
                    }

                    members3.push({
                        field: "508ba045-fb5d-4e3c-a081-80ee500705b3",
                        fieldName: "unit_id",
                        "fieldType": "TYPE_INTEGER",
                        valueType: "Constant",
                        values: res.result || [],
                        value: "",
                        operate: "In", // 范围查询
                        className: "Single"
                    });
                    var filter3 = {
                        "combine": "And",
                        "className": "List",
                        "members": members3
                    };
                    pageTableList3.dataEngine.state.layout.props.dataSet.filterData = {
                        "enabled": true,
                        "filter": filter3,
                        "filterType": "FILTER",
                        "rawCondition": {},
                        "rawFormula": ""
                    }

                    tableComp1.onRefresh();
                    tableComp2.onRefresh();
                    tableComp3.onRefresh();
                }
            }

        }

    }).catch(err => {
        self.$message.error(err.message); // 显示错误提示信息
    });
}

function main() {
    // 获取页面树实例
    var pageTreeEle = this.$$element("page_tree_hd1dng");
    // 获取树渲染实例
    var treeRenderEle = pageTreeEle.$$getRenderElement();
    // 获取当前树实例
    var treePanelEle = treeRenderEle.$$getTreeElement();
    // 获取第一个节点
    var firstNode = treePanelEle.$$getRootNode()[0].id;
    treePanelEle.$$clickNode({ key: firstNode });
}

function main(){

    let pageTreeEle = this.$$("page_tree_hd1dng");

    pageTreeEle.$children[0].$$setExtraParams({
        approvalResult: 0
    })
    let treeComp = pageTreeEle.dataEngine.state.getElement("tree_panel_78vxbg");
    if (treeComp) {
        treeComp.$$refreshData();
    }

}


function onTabClick(tab) {
    let approvalResultValue = '';
    if(tab == 2){
        approvalResultValue = 1;
    }else if(tab == 3){
        approvalResultValue = 2;
    } else{
        approvalResultValue = 0;
    }
    let pageTreeEle = this.$$("page_tree_hd1dng");

    pageTreeEle.$children[0].$$setExtraParams({
        approvalResult: approvalResultValue
    })
    let treeComp = pageTreeEle.dataEngine.state.getElement("tree_panel_78vxbg");
    if (treeComp) {
        treeComp.$$refreshData();
    }

}
